﻿//=============================================================================
// Project  : NIPO Component Framework
// File    : DataTransferObject.cs
// Author  : Bernhard Dieber (Bernhard.Dieber@uni-klu.ac.at)
// Copyright 2010 by Bernhard Dieber
// This code is published under the Microsoft Public License (Ms-PL).  A copy
// of the license should be distributed with the code.  It can also be found
// at the project website: http://NIPO.CodePlex.com.   This notice, the
// author's name, and all copyright notices must remain intact in all
// applications, documentation, and source files.
//=============================================================================

using System;
using System.Collections.Generic;
using System.Text;

namespace NIPO.Data
{
    /// <summary>
    /// This is the base class for transferring data in NIPO<br />
    /// This class shall be extended to serve different purposes (i.e. to transfer differen content types)
    /// </summary>
    [Serializable]
    public abstract class DataTransferObject
    {
        private readonly string _contentDescription;
        private readonly long _contentSize;
        private readonly Type _contentType;
        private DateTime _timestamp;

        /// <summary>
        /// Creates a new DTO
        /// </summary>
        /// <param eventName="contentType">The type of the content delivered in this DTO</param>
        /// <param eventName="contentDescription">String description of the content</param>
        /// <param eventName="contentSize">Size of the content (application-specific)</param>
        /// <param eventName="timestamp">Timestamp corresponding to a certain packet</param>
        protected DataTransferObject(Type contentType, string contentDescription, long contentSize, DateTime timestamp)
        {
            _contentType = contentType;
            _timestamp = timestamp;
            _contentSize = contentSize;
            _contentDescription = contentDescription;
        }
        /// <summary>
        /// Returns the type of content carried in this DTO
        /// </summary>
        public Type ContentType
        {
            get { return _contentType; }
        }

        /// <summary>
        /// Timestamp corresponding to this packet
        /// </summary>
        public DateTime Timestamp
        {
            get { return _timestamp; }
            set { _timestamp = value; }
        }

        /// <summary>
        /// Application specific description of the DTO's content
        /// </summary>
        public  string ContentDescription
        {
            get { return _contentDescription; }
        }

        /// <summary>
        /// Size of the data in the DTO (application-specific)
        /// </summary>
        public long ContentSize
        {
            get { return _contentSize; }
        }
    }
}